package demo.game.chess.common;

import java.io.Serializable;

public class ChessMove implements Serializable {

	private ChessCell originCell;

	private ChessCell targetCell;

	private EnumChessPiece pawnPromotion;

	private EnumCastling castling;

	public ChessMove() {

	}

	public ChessMove(final ChessCell originCell, final ChessCell targetCell) {
		super();
		this.originCell = originCell;
		this.targetCell = targetCell;
	}

	public ChessMove(final ChessCell originCell, final ChessCell targetCell,
			final EnumCastling kingRookSwap) {
		super();
		this.originCell = originCell;
		this.targetCell = targetCell;
		this.castling = kingRookSwap;
	}

	public EnumCastling getCastling() {
		return this.castling;
	}

	public ChessCell getOriginCell() {
		return this.originCell;
	}

	public EnumChessPiece getPawnPromotion() {
		return this.pawnPromotion;
	}

	public ChessCell getTargetCell() {
		return this.targetCell;
	}

	public void setPawnPromotion(final EnumChessPiece pawnPromotion) {
		this.pawnPromotion = pawnPromotion;
	}

	@Override
	public String toString() {
		return "move_" + this.getOriginCell() + "_" + this.getTargetCell();
	}

}
